﻿using System;
using System.Collections.Generic;
using System.Web;
using Universe.MediaProbe;

namespace MediaProbe.W3Test
{
    /// <summary>
    /// Summary description for GetImage
    /// </summary>
    public class GetImage : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            byte[] content;
            string contentType;
            SampleVideo.BuildScreen(out content, out contentType);
            var Response = HttpContext.Current.Response;
            Response.OutputStream.Write(content, 0, content.Length);
            Response.ContentType = contentType;
            Response.Flush();
            Response.End();
            HttpContext.Current.ApplicationInstance.CompleteRequest();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}